<template>
    <div v-loading="loading">
        <div class="c-right">
          <el-button @click="toMock()">默认按钮</el-button>
        </div>
        <div class="c-data" v-show="show1"> 

        </div>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="date" label="日期" width="180">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="180">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
        </el-table>
        <el-dialog title="选择" :visible.sync="show" @closed="show = false" >
             <el-button @click="toshow1()">默认按钮</el-button>
             <el-button @click="toshow2()">默认按钮</el-button>
        </el-dialog>
        <el-dialog title="选择1" :visible.sync="show1" @closed="show1 = false" >
            <el-date-picker
                v-model="value1"
                type="date"
                placeholder="选择日期">
                </el-date-picker>
        </el-dialog>
    </div>
</template>
<script>
    import { getList} from "../api"
    export default {
        name: "one",
        data() {
            return {
                tableData: [],
                show: false,
                value1: '',
                show1: false,
                loading: false
            }
        },
        created () {
            this.getData();
        },
        methods: {
            getData(){
                this.loading = true;
                getList().then(res=>{
                    this.loading = false;
                    // this.tableData = res.data;
                    console.log('res: ', res);
                }).catch(err=>{
                    console.log('err: ', err);
                })
            },
            toMock () {
                console.log(1)
                this.show = true
            }
        }
    };
</script>

<style>
.c-right {
    padding: 20px;
    text-align: right;
}

</style>